package com.zyf.EasyNet.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @first_author zyflzz
 * @gmt_created 2022/4/26
 * @gmt_modified 2022/4/26
 */
@Component
public class Global {

    private static final Logger LOG = LoggerFactory.getLogger(Global.class);

    public String getCurClassMethodName() {
        StringBuilder result = new StringBuilder();
        try {
            StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[2];
            String className = stackTraceElement.getClassName();
            String methodName = stackTraceElement.getMethodName();
            result.append(className).append(".").append(methodName);
        } catch (Exception e) {
            LOG.info(e.getMessage());
        }
        return result.toString();
    }
}
